import requests as r
import re
from pyquery import PyQuery as pq
url='http://www.mzitu.com/'
headers={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 SE 2.X MetaSr 1.0'}

rel_info=r.get(url,headers=headers).text
#print(rel_info)
#先提取第一页的所有图片的URL
ret=re.compile('<li><a href="(.*?)"').findall(rel_info)
for i in ret:
    #print(i)
    for p in range(1,45):
        html_info=i+'/'+str(p)
        doc=pq(html_info)
        a=doc('img')
        print(a.attr.src)
